<?php

/*
 * 判断每一行的商品是否是第一个商品
 * @param $value商品的索引
 * */
function getRowFirstItem($value){
    $result=$value%3;
    return $result;
}

/*
* 根据级别id和上级id，返回json数据
* @param int $parent_id
* @param int $region_type
* @return  json 集合
* @author www.e-sees.com
* */
function _getjson_regions_publicfun($parent_id,$region_type)
{
    $where=array();
    //如果有传入父级ID
    if($parent_id){
        $where['parent_id']=$parent_id;
    }

    //如果有传入类别id
    if($region_type){
        $where['region_type']=$region_type;
    }

    //根据条件查询记录
    $_datalist=M('region')->where($where)->field('region_name,region_id')->order('region_id')->select();
    $retdata['status']=0; //默认没有数据
    $retdata['datalist']='暂无数据'; //默认返回没有数据的提醒语句
    if($_datalist) //如果有查询到数据
    {
        $retdata['status']=1;
        $retdata['datalist']=$_datalist;
    }


    //返回json
    return json_encode($retdata);
}


function pay_fee($payment_id, $order_amount, $cod_fee=null)
{

    $pay_fee = 0;
    $payment=M('payment')->where(array('pay_id'=>$payment_id,'enabled'=>1))->find();

    $rate    = ($payment['is_cod'] && !is_null($cod_fee)) ? $cod_fee : $payment['pay_fee'];

    if (strpos($rate, '%') !== false)
    {
        // echo $order_amount;die;
        /* 支付费用是一个比例 */
        $val     = floatval($rate) / 100;
        // echo $val;die;
        //$order_amount * $val /(1 - $val)
        $pay_fee = $val > 0 ? $order_amount * $val  : 0;

    }
    else
    {
        $pay_fee = floatval($rate);
    }

    return round($pay_fee, 2);
}

function _get_card_information($consignee,$ID_card){


    $account='aoma_p_admin'; //账号
    $key='R2Qxt333'; //私钥
    $idNumber = $ID_card;//身份证号码
    $name = $consignee;//姓名
    $param=$idNumber . $account;
    $sign= strtoupper(md5(strtoupper(md5($param)) . $key));

//简项认证
//$url="https://service.sfxxrz.com/simpleCheck.ashx";

//多项认证
    $url="http://service.sfxxrz.com/exactCheck.ashx";
    $url .='?idNumber=' . $idNumber . '&name=' . $name .
        '&account=' . $account . '&pwd=' . $key . '&sign=' . $sign;


    $json = file_get_contents($url);

//    写入日志
    write_file_aomai_ftp_v2('infojson',"idcard_request",$json);

//    $json='{"ResponseCode":100,"ResponseText":"成功","Identifier":{"Address":"北京路","BirthPlace":"云南省昆明市","Birthday":"1968-07-18","Company":"社区","Education":"初中","FormerName":"王云龙","IDNumber":"530103196807180651","IsQueryCitizen":false,"MaritalStatus":"未婚","Name":"王云龙","Nation":"汉族","NativePlace":"江西省","Photo":"\/9j\/4AAQSkZJRgABAgAAAQABAAD\/\/gAKSFMwMQVgAADRBQB7HgD\/2wBDABgREhUSDxgVFBUbGhgdJDwnJCEhJEo1OCw8V01cWlZNVFNgbIp1YGaDaFNUeKR6g4+Tm5ybXXSqtqiWtIqYm5X\/2wBDARobGyQgJEcnJ0eVY1RjlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZX\/wAARCADcALIDASIAAhEBAxEB\/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL\/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6\/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL\/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6\/9oADAMBAAIRAxEAPwDe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LJI4tocGQkYBxz2\/z9KuR1DKobUIgfTP5ZrI0sTopEK7hhsc1VuCIsFgSDxxV41Svv8Aj0kPfbSGZGosJp1Kn5VHpVM\/ImOuKfGf3f0NRS9DW6VkYN3YctH706NQyj2pE+6KQnYxApiHZ5Y9R0FQqPmAbPNSfwD6mmN0FAEygBSBTWGDuFOTlB9acRkMKAGb19aKTyx6migD\/9k=","QueryTime":null,"Result":"一致","Sex":"男性"},"RawXml":null}';
    return $json;

}

function ID_card_fee($id_card_fee,$user_id){


    //用户信息
    $user_entity=M('users')->where(array('user_id'=>$user_id))->field('user_name,mobile_phone,user_money')->find();

    //用户扣款后的余额
    $surplus_user_money=$user_entity['user_money'] - $id_card_fee;

    //更新用户余额
    $user_data['user_money']=$surplus_user_money;
    $user_data['last_transaction_time']=time();
    M('users')->where(array('user_id'=>$user_id))->save($user_data);



    //插入余额变动记录
    $purchase_price_list['user_id']=$user_id;
    $purchase_price_list['user_name']=$user_entity['user_name'];
    $purchase_price_list['mobile']=$user_entity['mobile_phone'];
    $purchase_price_list['add_time']=time();
    $purchase_price_list['money']='-'.$id_card_fee;
    $purchase_price_list['in_or_out']="OUT";
    $purchase_price_list['transaction_type']=6;
    $purchase_price_list['reference']="";
    $purchase_price_list['remark']='身份证号码清关收费';
    $purchase_price_list['source_type']=6;
    $purchase_price_list['gathering_time']=date("Y-m-d H:i:s",time());//最后操作时间;
    $purchase_price_list['user_balance_details']=$surplus_user_money;//扣款后的余额
    M('purchase_price_list')->add($purchase_price_list);

    return;
}


function photo_clearance_fee($photo_clearance_fee,$user_id){


    //用户信息
    $user_entity=M('users')->where(array('user_id'=>$user_id))->field('user_name,mobile_phone,user_money')->find();

    //用户扣款后的余额
    $surplus_user_money=$user_entity['user_money'] - $photo_clearance_fee;

    //更新用户余额
    $user_data['user_money']=$surplus_user_money;
    $user_data['last_transaction_time']=time();
    M('users')->where(array('user_id'=>$user_id))->save($user_data);



    //插入余额变动记录
    $purchase_price_list['user_id']=$user_id;
    $purchase_price_list['user_name']=$user_entity['user_name'];
    $purchase_price_list['mobile']=$user_entity['mobile_phone'];
    $purchase_price_list['add_time']=time();
    $purchase_price_list['money']='-'.$photo_clearance_fee;
    $purchase_price_list['in_or_out']="OUT";
    $purchase_price_list['transaction_type']=6;
    $purchase_price_list['reference']="";
    $purchase_price_list['remark']='身份证号码清关收费';
    $purchase_price_list['source_type']=6;
    $purchase_price_list['gathering_time']=date("Y-m-d H:i:s",time());//最后操作时间;
    $purchase_price_list['user_balance_details']=$surplus_user_money;//扣款后的余额
    M('purchase_price_list')->add($purchase_price_list);

    return;
}
